﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FuelAbp
{
    /// <summary>
    /// 统一返回格式
    /// </summary>
    public class UnitiveResult<T>
    {
        public int Code {  get; set; }
        public string Message { get;set; }
        public T Data {  get; set; }

        public UnitiveResult(int code, string message, T data)
        {
            Code = code;
            Message = message;
            Data = data;
        }
        public static UnitiveResult<T> Success(T data)
        {
            return new UnitiveResult<T>(200, "请求成功", data);
        }
        public static UnitiveResult<T> Error(string message)
        {
            return new UnitiveResult<T>(500, message, default!);
        }

    }
}
